import request from '../utils/request'

const fetchCates = (params = {}) => (
  request.get('/cateLists', { params })
)
const addCate = (params = {}) => {
  return request.post('/addCate', params)
}
const fetchCateDetail = id => {
  return request.get('/getCate', { params: { id } })
}
const updateCate = (params = {}) => {
  return request.put('/updateCate', params)
}
const delCate = id => {
  return request.delete('/delCate', { params: { id } })
}
export {
  fetchCates,
  addCate,
  fetchCateDetail,
  updateCate,
  delCate
}
